<template>
  <div class="container">
    <!-- 上半部 -->
    <div class="profile" @click="$router.push('/edit')">
      <img src="@/assets/base-splash.jpg" alt="" />
      <div class="info">
        <div class="name">
          <span class="iconfont iconxingbienan"></span>
          火星网友
        </div>
        <div class="date">2001-12-12</div>
      </div>
      <span class="iconfont iconjiantou1"></span>
    </div>
    <div class="containerbtm">
      <Profilebar
        title="我的关注"
        desc="关注的用户"
        @click.native="loginx"
      />
      <Profilebar title="我的跟帖" desc="跟帖/回复" />
      <Profilebar title="我的收藏" desc="文章/视频"  @click.native="$router.push('/star')"/>
      <Profilebar title="设置" />
      <Profilebar title="退出" @click.native="loginout" />
    </div>
  </div>
</template>

<script>
import Profilebar from "../../components/Profilebar";
export default {
  mounted() {
    // console.log(localStorage.getItem("token"));
  },
  components: {
    Profilebar,
  },
  methods: {
    loginx() {
      this.$router.push('/follow')
    },
    loginout(){
      window.location.href='/',
      localStorage.removeItem('token')
      console.log('消除token');
    },
  },
  created(){
      
    //  页面创建完毕,开始获取数据
    this.$axios({
        url:'http://157.122.54.189:9083/user/' +  localStorage.getItem('userId'),
        //必须带上token令牌
        // headers:{
        //   Authorization:localStorage.getItem('token')
        // }
    }).then(res=>{
        console.log(res.data);
    })
  }
};
</script
    Profilebar>

<style lang="less" scoped>
@import url("http://at.alicdn.com/t/font_1426139_h6vn3jbl5q.css");
* {
  padding: 0;
  margin: 0;
}
a {
  text-decoration: none;
}
.container {
  height: 100vh;
  background-color: #f2f2f2;
}
.profile {
  display: flex;
  align-items: center;
  height: 100/360 * 100vw;
  padding: 20/360 * 100vw;
  img {
    border-radius: 50%;
    width: 70/360 * 100vw;
    height: 70/360 * 100vw;
    object-fit: cover;
  }
  .info {
    flex: 1;
    padding-left: 17/360 * 100vw;
    .name {
      padding-bottom: 10/360 * 100vw;
      font-size: 15/360 * 100vw;
      span {
        font-size: 16/360 * 100vw;
        color: skyblue;
      }
    }
    .date {
      color: #cccccc;
    }
  }
  border-bottom: 3px solid #e4e4e4;
}
.containerbtm {
  padding-left: 20/360 * 100vw;
}
</style>